
<template>
  <div class="job-info">
    <div class="job-title clearfix">
      <a :href="jobInfo.detailUrl" class="job-name">{{ jobInfo.name }}</a>
      <span class="job-salary">{{ jobInfo.salary }}</span>
    </div>
    <ul class="tag-list">
      <li v-for="(item, index) in tag" :key="index">{{ item }}</li>
    </ul>
  </div>
  <div class="job-bottom">
    <a :href="bossInfo.url" class="boss-info" target="_blank">
      <div class="boss-log"><img :src="bossInfo.logoPic" /></div>
      <span class="boss-name">{{ bossInfo.name }}</span>
    </a>
    <span class="company-location">{{ bossInfo.location }}</span>
  </div>
</template>

<script setup lang="ts">
import { defineProps, toRefs } from 'vue'
const props = defineProps(['job'])
// ("bossInfo": \{\n.+\n.+\n.+\n.+\n\s+\})
let { jobInfo, bossInfo, tag } = toRefs(props.job)
</script>

<style scoped>
.job-item .job-info {
  display: block;
  padding: 16px 20px;
}

.job-item .job-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 24px;
}

.job-item .job-title .job-name {
  flex: 1;
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
  color: #222;
  padding-right: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.2s linear;
}

.job-item.active .job-title .job-name,
.job-item:hover .job-title .job-name {
  color: #067aa4;
}

.job-item .job-title .job-salary {
  font-size: 20px;
  font-family: kanzhun-mix, kanzhun-Regular;
  font-weight: 500;
  color: #fe574a;
  line-height: 24px;
  height: 24px;
  flex-shrink: 0;
}

.job-item .tag-list {
  height: 22px;
  overflow: hidden;
  margin-left: -4px;
  margin-right: -4px;
  margin-top: 10px;
}

.job-item .tag-list li {
  float: left;
  margin-right: 4px;
  margin-left: 4px;
  background: #f8f8f8;
  border-radius: 4px;
  font-size: 16px;
  color: #666;
  line-height: 18px;
  padding: 2px 8px;
  transition: all 0.2s linear;
}

.job-item .job-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: linear-gradient(90deg, #e1f8fa, #ecf5ea);
  border-radius: 0 0 12px 12px;
}

.job-item .boss-info {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  margin-right: 4px;
  transition: all 0.2s linear;
}

.job-item .boss-log {
  position: relative;
  width: 24px;
  height: 24px;
  margin-right: 8px;
}

.job-item .boss-log img {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 100%;
}

.job-item .boss-name,
.job-item .company-location {
  font-size: 13px;
  color: #666;
  line-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-item .boss-info:hover .boss-name {
  color: #067aa4;
}
.job-item,
.company-location {
  flex-shrink: 0;
}
</style>
